<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<base href="${cxt}/">
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>后台登录</title>
<script src="js/jquery.min.js" type="text/javascript"></script>
<style type="text/css">
	*{
		margin:0px;
		padding:0px;
	}
	body{
		background-color:#0D3F70;
	}
	ul{
		list-style:none;
	}
	.login_title{
		color:#fff;
		margin-top:100px;
		text-align:center;
	}
	
	.login_content{		
		width:350px;
		height:300px;
		margin:50px auto;
		background-color:#fff;
	}
	.login_con{
		
	}
	.login_con p{
		text-align:center;
		color:red;
		height:30px;
	}
	
	.login_content ul{
		border:1px solid #fff;	
		margin-left:50px;
				
	}
	.login_content ul li{
		height:40px;
		margin-top:20px;
	}
	.login_content ul li input{
		height:40px;
		width:260px;
		text-indent:10px;
	}
</style>
<script type="text/javascript">

	//登录验证
	function login(){
		var msg = $("#error");
		//验证用户名不能为空
		if($("input[name=uname]").val()==null||
				$("input[name=uname]").val()==""){
			msg.text("请输入用户名");  //修改错误提示信息
			$("input[name=uname]").focus(); //输入框重新获取焦点		
			return;
		}
		//验证密码信息
		if($("input[name=pwd]").val()==null||
				$("input[name=pwd]").val()==""){
			msg.text("请输入密码");//修改错误提示信息
			$("input[name=pwd]").focus();//输入框重新获取焦点			
			return;
		}
		//验证码不能为空判断
		if($("input[name=yzm]").val()==null||
				$("input[name=yzm]").val()==""){
			msg.text("请输入验证码");//修改错误提示信息
			$("input[name=yzm]").focus();//输入框重新获取焦点			
			return;
		}	
		//提交表单		
		$("#lgform").submit();	
	}
	var count = 0;
	function getYZM1(){
		$("#yz").attr("src","/fuhe/yzmservlet?a="+count);
		count++;
	}
	
</script>
</head>
<body>
	<div class="login_title">
		<h1>福和租车后台</h1>
	</div>
	<div class="login_content">
		<div class="login_con">
			<!-- 错误提示 -->
			<p><span id="error">${msg} </span></p>
		<!-- 表单  -->
		<form id="lgform" action="adminlogin" method="post">		
			<ul>				
				<li><input name="uname" placeholder="请输入用户名"> </li>
				<li><input type="password" name="pwd" placeholder="请输入用密码"></li>
				<li><input name="yzm" placeholder="请输入验证码" style="width:100px;">
					<img id="yz" onclick="getYZM1()" src="/fuhe/yzmservlet" >
					<input name="yzm1" type="hidden" value="${yzm}">
				</li>
				<li><input type="button" name="sub" value="登  录" onclick="login()"></li>
			</ul>
		
		</form>
		</div>
	</div>
</body>
</html>